App.require(function () {
    var app = App.getCurrent();

    app.definePopUp("pcareaselect", {
        dispatchEventByName: function(name, data, page) {
            data = data || {};
            var result = { popUp: this };
            App.extend(App.extend(result, this.data), data);
            var currentPage = page || this.parent || app.currentPage;
            currentPage.dispatchEvent(name, result);
        },
        hiddenByOutEnv: function () {
            this.hidden();
            var target = this.data.target || app.currentPage;
            target.dispatchEvent("areaselecthiddenfromoutenv");
        },
        getOriginData: function(initValue, bk) {
            return this.data.getOriginData(initValue, bk);
        },
        getNextData: function(index, value, list, bk) {
            return this.data.getNextData(value, index, list, bk);
        },
        beforeShow: function () {
            if (document.activeElement) document.activeElement.blur();
            return true;
        }
    })
})